//
//  DrugViewController.h
//  TestARC
//
//  Created by wuxiaoquan on 12-9-22.
//  Copyright (c) 2012年 wuxiaoquan. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "BaseNavViewController.h"
#import <QuartzCore/QuartzCore.h>
#import "YXSearchBar.h"

#import "DBHelper.h"

@interface BaseSearchViewController : BaseNavViewController <UISearchBarDelegate,UITableViewDataSource,UITableViewDelegate>
{
    BOOL showSeggestView;
    BOOL showOverlayView;
}

@property IBOutlet YXSearchBar *searchBar;
@property IBOutlet UILabel *hipLabel;
@property IBOutlet UITableView *commonTableView;
@property IBOutlet UITableView *seggestionTableView;
@property IBOutlet UIView *overlayView;

@property DBHelper *dbHelper;

@property NSMutableArray *commonArray;
@property NSMutableArray *seggestionArray;


-(void)setCommonView;
-(void)loadCommonData;

-(void)loadSeggestionData:(NSString *)queryText;
-(void)setSeggestionView:(NSString *)queryText;

-(void)startSearch;
-(void)endSearch;
-(void)searchForText:(NSString *)queryText;
-(UIButton *)getSearchBarCancelButton;

-(IBAction)touchOverlay:(id)sender;
-(IBAction)dismissKeyboard:(id)sender;

-(void)setCellImage:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath;

-(void)changeCancelButton;

@end
